from sqlalchemy import String, DateTime
from sqlalchemy.dialects.mysql import BIGINT
from sqlalchemy.orm import Mapped, mapped_column

from owl_admin.ext import db


class KnowledgeBasePO(db.Model):
    __tablename__ = 'ai_rag_knowledge_base'
    __table_args__ = {'comment': 'AI向量知识库'}

    id: Mapped[int] = mapped_column(BIGINT(20), primary_key=True, comment='主键')
    name: Mapped[str] = mapped_column(String(255), comment='知识库名称')
    create_time: Mapped[DateTime] = mapped_column(DateTime, comment='创建时间')
    update_time: Mapped[DateTime] = mapped_column(DateTime, comment='更新时间')
    create_by: Mapped[int] = mapped_column(BIGINT(20), comment='创建人')
    update_by: Mapped[int] = mapped_column(BIGINT(20), comment='更新人')
